<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>{{$store.state.count}}</h2>
    <button @click="tap()">按钮</button>
    
  </div>
</template>

<script>
import * as api from '../api/getProlist'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  methods:{

    tap(){
      // this.$store.commit('add')
      this.$store.dispatch('asyncAdd')
    }
  },
  mounted(){
        this.$emit('toparent',this.title)
        api.getProlist({
            uid:19802,
            pagesize:19
        }).then((data)=>{
            console.log(data.data)
            this.list=data.data.data

        })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
  font-size:24px;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
